<!--#INCLUDE FILE="conn.asp"-->
<!--#include file="ad_function.asp"-->
<!-- #include file="aFunction_charCode.asp" -->
<!-- #include file="ad_comSub.asp" -->

<%
Call tslt_useridentity12_error_end()

dim rs
dim sql,bulletin, bulletin_close
sql="select * from option1"
set rs=conn.execute(sql)
          bulletin_save=rs("bulletin_save")
          bulletin_close=rs("bulletin_close")
          if bulletin_close=true then
               str2="checked"
          else
               str1="checked"
          end if
          if rs("bulletin_save")=true then
               str3="checked"
         end if
%>
        <html>
        <head>
        <title></title>
        <link href=../style/<%=session("tslt_stylefolder")%>/admin.css rel="stylesheet" type="text/css">
        </head>
        <body bgcolor=#aaaac4>
        <CENTER>
        <br>
        <table><tr><td class="font2">̳</td></tr></table>
        <br>

<%
         dim sure
         sure = Request("Mybulletin") 
         if sure = "ok" then
                call MyBulletin()
         end if
%>

        <table border=1 width=70%  cellpadding="5" cellspacing="0" style="BORDER-LEFT:#0098c8 1PX SOLID;BORDER-RIGHT:#0098c8 1PX SOLID;BORDER-TOP:#0098c8 1PX SOLID;BORDER-BOTTOM:#0098c8 1PX SOLID">
             <form action="bulletin.asp" method="POST">
             <input type="hidden" name="Mybulletin" value="ok">
             <tr align="center" bgcolor=#9BC4FF height="30">
                  <td>
                          <b>̳</b>
             <tr align="center" bgcolor=#FFFFFF>
                  <td>
                          <br>
                          <input type="radio" value="yes" name="openbulletin" <%=str1%>>򿪹 
                          <input type="radio" value="no" name="openbulletin" <%=str2%>> رչ
                          <input type="checkbox"  name="savebulletin" <%=str3%>> 湫
                          <br>
                          <input type=hidden name=s_SavePath value=<%=rs("bulletin_SavePathFileName")%>>
                          <input type=hidden name=s_savepathfilename>
                          <TEXTAREA cols=40 name=content  style="display:none" rows=6><%=Server.HtmlEncode(rs("bulletin"))%></TEXTAREA>
                          <iframe ID="eWebEditor1" src="../ewebeditor/ewebeditor.htm?id=content&style=coolblue&savepathfilename=s_savepathfilename" frameborder="0" scrolling="no" width="550" HEIGHT="280"></iframe>
                          <p>
                          <input type="submit" value="      " name="B1">
                          <input type="reset" value="    д  " name="B2">
             <tr align="center" bgcolor=#9BC4FF height="30">
                  <td></td>
            </tr>
            </form>
        </table>
        </CENTER>
        </body>
        </html>
<%
rs.close
set rs=nothing

Call conn_Nothing()

sub MyBulletin() 
              dim sContent ,sSavePathFileName,sSavePath,s_SavePath,openbulletin
              dim savebulletin
               sContent = ""
               For i = 1 To Request.Form("content").Count
                     sContent = sContent & Request.Form("content")(i)
               Next 
               sSavePathFileName = GetSafeStr(Request.Form("s_savepathfilename"))
               s_SavePath = Request("s_SavePath")
               if s_SavePath<>"" then
                      if sSavePathFileName<>"" then
                             s_SavePath = s_SavePath &"|"& sSavePathFileName
                      else
                             s_SavePath = s_SavePath
                      end if
               else
                      if sSavePathFileName<>"" then
                             s_SavePath = sSavePathFileName
                      else
                             s_SavePath = ""
                      end if
               end if
               if instr(s_SavePath,"|")=0 then 
                      if instr(sContent,s_SavePath)=0 then 
                             s_SavePath=""
                      else
                             s_SavePath=s_SavePath
                      end if
               else
                      dim rrr
                      rrr=""
                      arrays=Split(s_SavePath,"|")
                      for j=0 to ubound(arrays)
                           if instr(sContent,arrays(j))=0 then
                                  arrays(j)=""
                           else
                                  arrays(j)= "|" & arrays(j)
                           end if
                           rrr=rrr &arrays(j)
                      next
                      s_SavePath=rrr
               end if
               if Left(s_SavePath,1)="|" then
                     s_SavePath=right(s_SavePath,Len(s_SavePath)-1)
               end if
               openbulletin=request.form("openbulletin")
               savebulletin=request.form("savebulletin")
               if openbulletin="no" then
                      bulletin_close = true
                      if savebulletin="on" then
                             savebulletin = true
                             sContent =sContent
                             s_SavePath =s_SavePath
                             Response.write "<SCRIPT language=Javascript>passwords(promptInfo_bulletin(0))</SCRIPT>"
                      else
                             savebulletin = false
                             sContent =""
                             s_SavePath =""
                             Response.write "<SCRIPT language=Javascript>passwords(promptInfo_bulletin(1))</SCRIPT>"
                      end if
               elseif openbulletin="yes" then
                      bulletin_close = false
                      savebulletin = true
                      sContent =sContent 
                      if sContent ="" then
                             Response.write"<SCRIPT language=Javascript>passwords(promptInfo_bulletin(2))</SCRIPT>"
                      else
                             Response.write"<SCRIPT language=Javascript>passwords(promptInfo_bulletin(3))</SCRIPT>"
                      end if 
              end if
              conn.execute("update option1 set bulletin='"&sContent &"',bulletin_SavePathFileName='"&s_SavePath&"',bulletin_save="&savebulletin)
              conn.execute("update option1 set bulletin_close="&bulletin_close)
              Response.write"<META HTTP-EQUIV='Refresh' content='3; URL=bulletin.asp'>"
end sub
%>
